<#assign module="member"/>

<@override name="header">
<link rel="stylesheet" href="${ctx}/assets/css/datetimepicker.css">
</@override>
<@override name="body">

<div class="row">
	<div class="col-xs-12">
	    <div class="orders-navt col-xs-9" style="padding-left:0">
	   		<ul class="orders-nav">
	  			<li class="orders-notclick " style="width:90px;"><a class="tab" href="${ctx}/member/list">所有用户</a></li>
		  		<li class="orders-click" style="width:90px;"><a class="tab" href="${ctx}/member/elist">企业信息</a></li>
		  		<li class="orders-notclick" style="width:90px;"><a class="tab" href="${ctx}/member/gradelist">用户等级</a></li>
		  		<li class="orders-notclick" style="width:90px;"><a class="tab" href="${ctx}/member/lock">登录记录</a></li>
		  		<@shiro.hasPermission name='blacklist'>
		  			<li class="orders-notclick" style="width:90px;"><a class="tab" href="${ctx}/member/blacklist">黑名单</a></li>
		  		</@shiro.hasPermission>
		  		<@shiro.hasPermission name='phonevisit'>
		  			<li class="orders-notclick" style="width:90px;"><a class="tab" href="${ctx}/phonevisit/list">回访记录</a></li>
		  		</@shiro.hasPermission>
		  		<@shiro.isMainCompany>
				  <@shiro.hasPermission name='memberapply'>
				  	<#--
				  	<li class="orders-notclick" style="width:90px;"><a class="tab" href="${ctx}/memberapply/list">VIP申请</a></li>
				  	-->
				  </@shiro.hasPermission>
			  	</@shiro.isMainCompany>
			  	<@shiro.hasPermission name='receipt'>
			  		<li class="orders-notclick" style="width:90px;"><a class="tab" href="${ctx}/receipt/list">发票申请</a></li>
			   	</@shiro.hasPermission>
			   	<@shiro.hasPermission name='membernotice'>
			   		<li class="orders-notclick" ><a class="tab" href="${ctx}/membernotice/list">通知</a></li>
			   	</@shiro.hasPermission>
		    </ul>
		</div>
		<div class="col-xs-3" style="padding:0;">
			<@shiro.hasPermission name='memberedit'>
			<button class="pull-right btn btn-primary" onclick="window.location='${ctx}/member/addPersonal';"><b>+</b>&nbsp;添加个人客户</button>
			<button class="pull-right btn btn-primary btn-primary-a" onclick="window.location='${ctx}/member/addEnterprise';"><b>+</b>&nbsp;添加企业客户</button>
  			</@shiro.hasPermission>
  		</div>
	</div>
  	
</div>

<div class="tab-content">
	<div class="container-fluid ">
  		<div class="row query-pad">
  			<div class="col-xs-11" style="padding: 0px;">
  			    <@shiro.isMainCompany>
	          			<div class="col-xs-4 input-query" style="text-align: center;">
	            			<span>所属公司：</span>
	            			<input type="text" class="form-control form-contb" id="companyName" name="companyName" placeholder="请输入公司名称"/>
		            	</div>
	            </@shiro.isMainCompany>
      			<div class="col-xs-4 input-query">
        			<span>企业名字：</span>
        			<input type="text" class="form-control form-contb" id="name" name="name"  placeholder="请输入企业名字">
        		</div>
        		<div class="col-xs-4 input-query">
	        			<span>企业地址：</span>
	        			<input type="text" class="form-control form-contb" id="address" name="address"  placeholder="请输入企业地址">
	        	</div>
        		<#--<div class="col-xs-8 input-query" style="text-align: center;">
	        			<span>起始时间：</span>
	        			<input type="text" class="form-control form-conthtl" id="startTime" name="startTime"  placeholder="请输入起始时间"/>
	        			<span style="width:5%">到</span>
	        			<input type="text" class="form-control form-conthtl" id="endTime" name="endTime"  placeholder="请输入结束时间"/>
	           </div>-->
    		</div>
    		<div class="col-xs-1"style="padding: 0px;">
    			<div class="input-query-bttom">
        			<button id="searchButton" class="btn btn-primary">&nbsp;查询</button>
        		</div>
    		</div>
  		</div>
  		
  		<div class="choose" style="display: none;">
  			<div class="col-xs-12" style="padding: 0px;">
  				<div class="col-xs-11" style="padding: 5px;">
		            <div class="col-xs-4 input-query" style="text-align: center;">
					<span>发票申请时间：</span>	
					<input type="text" class="form-control form-conthtl"  id="startTime" name="startTime" placeholder="请输入开始时间"">
					<span style="width:5%">到</span>
					<input type="text" class="form-control form-conthtl"  id="endTime" name="endTime" placeholder="请输入结束时间" >
				</div>
            	</div>
  			</div>
  			
        	<div class="col-xs-12" style="padding:5px; line-height:3;">
  				<div class="media-wit melect">
					<span>用户等级：</span>
					<#if grades??>
						<#list grades as grade>
							<input type="checkbox" name="gradeId" value="${grade.id} ">
				  		 	<span class="checkbox-margin">${grade.name?if_exists} </span>
						</#list>
					</#if>
  				</div>
			</div>
  		</div>
  		<div class="query-jiant">
			<a href="#"><img id="jiant" src="${ctx}/assets/img/jiant2.png" /></a>          			
  		</div>
  	</div>
</div>

	
<div class="tabta-content">  	
	<table class="table table-condensed table-striped">
		<tbody>
			<tr style="font-size:14px;">
				<th>企业名称</th>
				<th>企业地址</th>
				<th>允许签单</th>
				<th>余额(可提现)</th>
				<th>余额(不可提现)</th>
				<th>所属公司</th>
				<th>等级</th>
				<th>注册时间</th>
				<th>操作</th>
			</tr>
		</tbody>
	</table>
	<br>
	<div style="text-align:center" id="NoData"></div>
	</br>
	<ul class="pagination pull-left pagination-sm pageshow" style="display:none;">
		<li><a></a></li>
	</ul>
	<ul class="pagination pull-left pagination-sm pagedata" style="display:none;">
    </ul>
</div>
</@override>

<@override name="footer">
	<script type="text/javascript">
		window.daijia = {
			ctx:'${ctx}',
			userId:'<@shiro.principal property='id'/>'
		};
		var membermoneyview=false;
		var memberedit=false;
		<@shiro.hasPermission name='membermoneyview'>
			membermoneyview=true;
		</@shiro.hasPermission>
		<@shiro.hasPermission name='memberedit'>
			memberedit=true;
		</@shiro.hasPermission>
	</script>
	<script src="${ctx}/assets/js/pushmessage.js"></script>
	<script src="${ctx}/assets/js/jquery.paging.min.js"></script>
	<script src="${ctx}/assets/js/bootstrap-datetimepicker.min.js"></script>
	<script src="${ctx}/assets/js/bootstrap-datetimepicker.zh-CN.js"></script>
	<script src="${ctx}/assets/js/member/elist.js"></script>
	<script type="text/javascript">
		var thisButton;
		function deleteEnterprise() {
		    $.post('${ctx}/member/deleteEnterprise',{'id':thisButton.attr("data-value")},function(data){
		            if(data.success){
		                $.scojs_message('企业删除成功', $.scojs_message.TYPE_OK);
		                window.location.reload(true);
		            } else {
		                $.scojs_message(data.message, $.scojs_message.TYPE_ERROR);
		            }
		    },'json');
		}
		$(document).ready(function(){
		
			$("#startTime").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true });
			$("#endTime").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true });
			
			$(document).on("click",".deletethis",function(){
				thisButton = $(this);
          		var confirm = $.scojs_confirm({
            		content: "您确认要删除企业吗？删除后相关客户的所有相关财务记录余额订单记录将全部清空，你也可以将客户加入黑名单，他/她将无法再下单！",
		            action:deleteEnterprise
          		});
          		confirm.show();
			});
		});
	</script>
</@override>
<@extends name="../layout.ftl"/>